package com.eobard.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: Eobard Gu
 * @Date: 2025-07-22
 * @Description: TODO
 */
@Data
@NoArgsConstructor
@TableName("t_mq_message")
public class MqMessage {
    @TableId
    private Long id;
    private String messageId;           //消息业务唯一id
    private String lastCorrelationId;   //最后一次消息发送id(默认情况下与messageId一致)
    private String exchangeName;
    private String routingKey;
    private String messageBody;
    private boolean status;
    @TableLogic(value = "0", delval = "1")   // 1表示已删除，0表示未删除
    private boolean deleted;

    public MqMessage(String messageId, String lastCorrelationId, String exchangeName, String routingKey, String messageBody, boolean status) {
        this.messageId = messageId;
        this.lastCorrelationId = lastCorrelationId;
        this.exchangeName = exchangeName;
        this.routingKey = routingKey;
        this.messageBody = messageBody;
        this.status = status;
    }
}
